﻿using Microsoft.EntityFrameworkCore;
using System.Linq;

namespace CommonUtils.Web.Test
{
    public class Database : DbContext
    {
        public Database(DbContextOptions<Database> options) : base(options) { }

        [Comment("充值码")]
        public DbSet<RechargeCode> RechargeCodes { get; set; }

        public IQueryable<TEntity> FromSql<TEntity>(string sql) where TEntity : class
        => Set<TEntity>().FromSqlRaw(sql);
    }
}
